package com.ruoyi.matrix.mapper

import com.ruoyi.matrix.domain.Customer
import com.ruoyi.matrix.condition.CustomerCondition
import org.apache.ibatis.annotations.Mapper
import org.apache.ibatis.annotations.Param

/**
 * 客户Mapper接口
 * 
 * @author matrix
 * @date 2023-06-08
 */
@Mapper
interface CustomerMapper {

    /**
     * 查询客户列表
     * 
     * @param customerCondition 客户Condition
     * @return 客户集合
     */
    fun selectCustomerList(@Param("condition") customerCondition: CustomerCondition): List<Customer>

    /**
     * 新增客户
     * 
     * @param customer 客户
     * @return 结果
     */
    fun insertCustomer(customer: Customer): Int

    /**
     * 修改客户
     * 
     * @param customer 客户
     * @return 结果
     */
    fun updateCustomer(customer: Customer): Int

    /**
     * 删除客户
     * 
     * @param id 客户主键
     * @return 结果
     */
    fun deleteCustomerById(id: Long): Int

    /**
     * 批量删除客户
     * 
     * @param ids 需要删除的数据主键集合
     * @return 结果
     */
    fun deleteCustomerByIds(ids: Array<Long>): Int

/**
     * 总数
     * @param customerCondition
     * @return
     */
    fun count(@Param("condition")  customerCondition: CustomerCondition): Long

    /**
     * group by
     * @param customerCondition
     * @return
     */
    fun groupByCustomer(@Param("condition") customerCondition: CustomerCondition): List<Customer>
}
